#include <iostream>
#include <iomanip>
using std::fixed;
using std::setprecision;
using std::cout;
using std::cin;
using std::endl;

#define PI 3.14
/*
编写一个圆类Circle，该类拥有：

① 1个成员变量，存放圆的半径；
 ② 两个构造方法 Circle( )
 // 将半径设为0 Circle(double r )
 //创建Circle对象时将半径初始化为r
 ③ 三个成员方法 double getArea( )
 //获取圆的面积 double getPerimeter( )
 //获取圆的周长 void show( )
 //将圆的半径、周长、面积输出到屏幕
*/

class Circle {
public:
    //将半径设为0
    Circle()
        :m_r(0)
    {
    }
    //创建Circle对象时将半径初始化为r
    Circle(double r)
        :m_r(r)
    {
    }
    //将圆的半径、周长、面积输出到屏幕
    void show() {
        cout << fixed << setprecision(2) << "r = " << m_r << endl;
        cout << fixed << setprecision(2) << "Area = " << getArea() << endl;
        cout << fixed << setprecision(2) << "Perimeter = " << getPerimeter() << endl;
    }
protected:
    //获取圆的面积
    double getArea() {
        return PI * PI * m_r * m_r;
    }
    //获取圆的周长
    double getPerimeter() {
        return 2 * PI * m_r;
    }

private:
    double m_r;
};
void test() {
    Circle c;
    c.show();
    Circle c2(1.666);
    c2.show();

}
int main() {
    test();
    return 0;
}